<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title><?=Micro::config('site_title');?></title>
<style>
h3 { letter-spacing:0.25em;}
code {background:#eee;}
pre {background:#FFE; border:1px solid #CCC; padding:10px;}
</style>
</head>

<body>
<h1><?=Micro::config('site_title');?></h1>
<p>Micro is for building micro and <em>Catalog-style</em> websites that don't require much fluff. The native PHP template functions can be used as normal to increase speed. Easy drop-n-play libraries can extend Micro effortlessly.</p>
<h1>TOC</h1>
<ul>
	<li><a href="?features">Features</a></li>
	<li><a href="?todo">Todo</a></li>
	<li><a href="?filesystem">Filesystem</a></li>
	<li><a href="?installation">Installation</a></li>
	<li><a href="?helpers">Helpers</a></li>
	<li><a href="<?=url::site("simplepie.php");?>">Test Simplepie Plugin</a></li>
</ul>
<hr />

<?php if ( isset($_GET['features']) || empty($_GET) ) : ?>

<h2>Start Using it out of the box</h2>
<h3>Features</h3>
<ul>
	<li>Extremely lightweight</li>
	<li>Shortest learning curve</li>
	<li>Extremely easy to extend</li>
	<li>PHP 5 OOP</li>
	<li>$_GET, $_POST work as expected</li>	
</ul>

<?php elseif ( isset($_GET['todo']) ): ?>

<h2>Todo</h2>
<ol>
	<li>Write documentation</li>
	<li>Clean up files</li>
	<li>Conventions for class files. Make the search for lowercase file names</li>
	<li>Separate libraries and config files somehow</li>
</ol>

<?php elseif ( isset($_GET['installation']) ): ?>

<h2>Installation</h2>
<p>Installation is as easy as uploading the directory structure to you server and modifing the following files:</p>
<p>In the <code>/.htaccess</code> file, add the relative directory where Micro is installed.</p>
<pre>
# Installation directory
RewriteBase /
</pre>

<p>In the <code>/index.php</code> file, modify the variables as needed. The file is well commented.</p>
<pre>
/**
 * Define the website environment status.
 */
define('IN_PRODUCTION', FALSE);

/**
 * Website Pages
 * This path can be absolute or relative to this file.
 */
$micro_pages = 'pages';

...and so on
</pre>

<p>In the <code>/system/config.php</code> file, change this to the domain name and installation folder where Micro is installed.</p>
<pre>
// Site domain and install directory. Without http:// or https://
$config['site_domain'] = 'www.mysite.com/';
</pre>

<p>When adding plugins, upload them to <code>/classes/</code> and use them as needed. Micro will load them Only when needed.</p>


<?php elseif ( isset($_GET['filesystem']) ): ?>

<h2>The MICRO Filesystem</h2>
<pre>
index.php
+ - pages
|   - home.php
|   - docs.php  
+ - classes
+ - system
|   - Bootstrap.php
|   - Micro.php
|   - Router.php
|   - Benchmark.php
|   - 404.php
</pre>

<?php elseif ( isset($_GET['helpers']) ): ?>

<h2>Helpers</h2>
<p>Helper files contatain collections of static functions that help you with development.</p>

<h3>url::current();</h3>
<p>This will return the current uri string. If set to <code>TRUE</code> the query string will also return with the value.
<pre>url::current(); = <?=url::current();?></pre>
<pre>url::current(TRUE); = <?=url::current(TRUE);?></pre>
</p>

<h3>url::base();</h3>
<p>This will return the current URL defined by the config.php variables:  <code>site_protocol</code> and <code>site_domain</code>.
<pre>url::base(); = <?=url::base();?></pre>
<p><code>url::base()</code> accepts two optional parameters. Set the first parameter to <code>TRUE</code> if you want to append the <code>index_page</code> defined in config.php to the base URL. Via the second parameter you can overwrite the default <code>site_protocol</code> from config.php.</p>
<pre>url::base(TRUE, "https"); = <?=url::base(NULL, "https");?>index.php/</pre>
</p>

<h3>url::site();</h3>
<p>This will return a URL based on the <code>site_protocol</code>, <code>site_domain</code>, and <code>index_page</code> defined in the config.php.
<pre>url::site(); = <?=url::site();?></pre>
<p><code>url::site()</code> accepts two optional parameters. You can pass URL folders/file (or segments) via the first parameter. The second allows you to override the <code>site_protocol</code> from the config.php.</p>
<pre>url::site("some/folder/test.php"); = <?=url::site("some/folder/test.php");?></pre>
</p>
<?php endif; ?>

<hr><p>Running Micro v{micro_version}. Rendered in  {execution_time} seconds. Using  {memory_usage} of memory.</p><a href="?#top">home</a>
</body>
</html>